package com.usian.controller;

import com.usian.CatResult;
import com.usian.Result;
import com.usian.feign.ItemFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/frontend/itemCategory")
@RestController
public class ItemCategoryController {

    @Autowired
    private ItemFeign itemFeign;

    /**
     * 首页查询分类列表
     *
     * @return
     */
    @RequestMapping("selectItemCategoryAll")
    public Result selectItemCategoryAll(){
        CatResult catResult = itemFeign.selectItemCategoryAll();
        if (catResult.getData().size()>0) {
            return Result.ok(catResult);
        }
        return Result.error("查无数据");
    }
}
